import { useEffect, useState } from "react";
import Side from "./side";
import { ConfigProvider, DatePicker, message } from "antd";
import { websiteStore } from "./store/index.js";
import { Main } from "./content";

export default function App() {
  const [color, setColor] = useState();
  useEffect(() => {
    window.utools.onPluginDetach(() => {
      setColor("#dfdfdf");
      console.log("插件应用分离为独立窗口");
    });
  }, []);

  return (
    <ConfigProvider>
      <websiteStore.Provider>
        <div className="flex h-screen" style={{ backgroundColor: color }}>
          <div className="w-16 overflow-hidden">
            <Side />
          </div>
          <div className="flex-1 bg-white m-2 mt-0 ml-0 rounded-xl overflow-hidden shadow-xl relative">
            <Main />
          </div>
        </div>
      </websiteStore.Provider>
    </ConfigProvider>
  );
}
